function dirList = getSubDirectories(dirName)
%getSubDirectories - returns all subfolders in the directory.
  dirData = dir(dirName);      % Get the data for the current directory
  dirIndex = [dirData.isdir];  % Find the index for directories
  dirList = {dirData(dirIndex).name}';
  dirList(ismember(dirList,{'.','..'})) = [];
  % Prepend path to files
  if ~isempty(dirList)
    dirList = cellfun(@(x) fullfile(dirName,x),...  
                       dirList,'UniformOutput',false);
  end
  dirList = sort(dirList);
end